#ifndef SingletonH
#define SingletonH

template <typename T>
class Singleton
{
    public:
        virtual ~Singleton () {};
        static T* getInstance ()
        {
            if (!singletonInstance)
            {
                singletonInstance = new T ();
            }
            return singletonInstance;
        }

    protected:
        Singleton () {};
        static T* singletonInstance;
        
};


template <typename T>
T* Singleton<T>::singletonInstance;

#endif